package com.walter.controller;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.walter.pojo.Resource;
import com.walter.pojo.WalterJSONResult;

@RestController
public class HelloController {
	
	@Autowired
	private Resource resource;
	
	@RequestMapping("/hello")
	public Object hello(){
		return "hello springBoot";
	}
	

	@RequestMapping("/getResource")
	public WalterJSONResult getResource(){
		Resource bean=new Resource();
		//属性复制
		BeanUtils.copyProperties(resource, bean);
		
		return WalterJSONResult.ok(bean);
	}
}
